package com.stedu;

import com.stedu.bean.Course;
import com.stedu.mapper.*;
import com.stedu.service.CourseService;
import com.stedu.service.TeacherAndStudentService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;

@SpringBootTest
public class SelectClassApplicationTests3 {
    @Autowired
    private CourseMapper courseMapper;
    @Autowired
    private CourseService courseService;
    @Autowired
    private StudentMapper studentMapper;
    @Autowired
    private TeacherAndStudentMapper teacherAndStudentMapper;
    @Autowired
    private TeacherAndStudentService teacherAndStudentService;
    @Autowired
    private TeacherMapper teacherMapper;
    @Autowired
    private AdminMapper adminMapper;
    @Test
    public void test1(){
        Course c = new Course(8, "008", "语文", new Date(), 20, 64, "666");
        System.out.println(courseService.update(c));
    }

    @Test
    public void test2(){
        Integer []sids={1,2,3};
        teacherAndStudentMapper.InsertTidAndSid(3,sids);
    }
    @Test
    public void test3(){
        teacherAndStudentMapper.selectAll().stream().forEach(System.out::println);
    }
    @Test
    public void test4(){
        teacherAndStudentService.selectAll().stream().forEach(System.out::println);
    }
    @Test
    public void test5(){
        studentMapper.selectByZid(1).stream().forEach(System.out::println);
    }
    @Test
    public void test6(){
        teacherMapper.selectAll().forEach(System.out::println);
    }
    @Test
    public void test7(){
        System.out.println(adminMapper.selectByUsername("admi00n"));
    }

}
